package math

import (
	"JVM/Jvmgo/GoToJVM/instructions/base"
	"JVM/Jvmgo/GoToJVM/runtimeData"
)

/*
	布尔运算 and
*/

type IAND struct {
	base.NoOperandsInstruction
}
type LAND struct {
	base.NoOperandsInstruction
}

func (self IAND) Execute(frame *runtimeData.Frame) {
	stack := frame.OperandStack()
	val2 := stack.PopInt()
	val1 := stack.PopInt()
	res := val1 & val2
	stack.PushInt(res)
}
func (self LAND) Execute(frame *runtimeData.Frame) {
	stack := frame.OperandStack()
	val2 := stack.PopLong()
	val1 := stack.PopLong()
	res := val1 & val2
	stack.PushLong(res)
}
